﻿<%@ Page Title="" Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="Products.aspx.vb" Inherits="ProductsPage" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <center>
        <h1>Products</h1>
    </center>
<%--<div id="featuredContent">

</div>--%>
<div id="prodlist">
   <asp:DataList RepeatColumns="3" RepeatDirection="Horizontal"  RepeatLayout="Table" 
                ID="DataList1" runat="server" DataSourceID="AccessDataSource1"
                CellSpacing="50">    
    <ItemTemplate>
        <div>
            <table width="100%">
            <tr>
                <td>
                <asp:Label ID="lblCategory" runat="server" Text='<%# Eval("CategoryName") %>'/><br />
                <asp:Label ID="lblName" runat="server" Text='<%# Eval("ProductName") %>'/><b><asp:Label ID="lblPersonalize" runat="server" Text=" - Personalizable" Visible='<%# Eval("CanPersonalize") %>'/></b><br />
                <asp:Label ID="lbldescr" runat="server" Text='<%# Eval("ProductDesc") %>'/>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <asp:Image ID="imgproduct" AlternateText='<%# Eval("ProductName") %>' runat="server" Width="300px" ImageUrl='<%# Eval("ImagePath") %>' />
                </td>
            </tr>
            <tr>
                <td>
                <b style="font-size:14pt;"><asp:Label ID="Label1" runat="server" Text="Price: $"/>
                <asp:Label ID="lblprice" runat="server" Text='<%# Eval("Amount")%>' /></b>
                </td>
                <td align="right">
                    <asp:Button ID="btnaddtocart" CommandArgument='<%# Eval("ProductID").toString() & "|" & Eval("ProductName").toString() & "|" & Eval("ProductDesc").toString() & "|" & Eval("ImagePath").toString() & "|" & Eval("CanPersonalize").toString() & "|" & Eval("Amount").toString %>' runat="server" CssClass="btn" 
                    Text="Add to Cart" onclick="btnaddtocart_Click" />
                </td>
            </tr>
            </table>
        </div>
    </ItemTemplate>
    </asp:DataList>
</div>
<asp:AccessDataSource ID="AccessDataSource1" runat="server"  DataFile="~/App_Data/GotPink.accdb" 
    SelectCommand="SELECT Category.CategoryName, Products.ProductID, Products.ProductName, Products.ProductDesc, Products.Amount, Products.ImagePath, Products.CanPersonalize FROM (Category INNER JOIN Products ON Category.CategoryID = Products.CategoryID) WHERE (Products.IsVisible = True) AND (Category.IsVisible = True) AND ProductID <> 16">
</asp:AccessDataSource>
<br />      

</asp:Content>

